using System;
using System.Runtime.InteropServices;

namespace ScenarioFramework.WAPI
{
	/// <summary>
	/// Descrizione di riepilogo per wrpWAPIWorkItem.
	/// </summary>
	public class WorkItem
	{
		/// <summary>
		/// Initializes a new instance  of the <see cref="WorkItem"/> class.
		/// </summary>
		public WorkItem()
		{
		}

		/// <summary>
		/// Sets the work item attributes.
		/// </summary>
		/// <param name="xmlActivity">The XML activity.</param>
		/// <param name="xmlAttributes">The XML attributes.</param>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport("WAPI.Dll", EntryPoint="setWorkItemAttributes")]
		private static extern String SetWorkItemAttributes(String xmlActivity, String xmlAttributes, String sOwner, ref Response response);

		/// <summary>
		/// Gets the work item attributes.
		/// </summary>
		/// <param name="xmlActivity">The XML activity.</param>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport("WAPI.Dll", EntryPoint="getWorkItemAttributes")]
		private static extern String GetWorkItemAttributes(String xmlActivity, String sOwner, ref Response response);

		/// <summary>
		/// Gets the work item list.
		/// </summary>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport("WAPI.dll", EntryPoint="getWorkItemList")]
		private static extern String GetWorkItemList(String sOwner, ref Response response);

		/// <summary>
		/// Gets the work item list by notify.
		/// </summary>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport("WAPI.dll", EntryPoint="getWorkItemListByNotify")]
		private static extern String GetWorkItemListByNotify(String sOwner, ref Response response);

		/// <summary>
		/// Gets the work item list no running.
		/// </summary>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport("WAPI.dll", EntryPoint="getWorkItemListNoRunning")]
		private static extern String GetWorkItemListNoRunning(String sOwner, ref Response response);

		/// <summary>
		/// Gets the work item list no running by process.
		/// </summary>
		/// <param name="lProcessID">The l process ID.</param>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport("WAPI.dll", EntryPoint="getWorkItemListNoRunningByProcess")]
		private static extern String GetWorkItemListNoRunningByProcess(ref Response response, String sOwner, long lProcessID );

		[ DllImport("WAPI.dll", EntryPoint="getWorkItemListRunningByProcess")]
		private static extern String GetWorkItemListRunningByProcess(ref Response response, String sOwner, long lProcessID );

		/// <summary>
		/// Gets the work item list running.
		/// </summary>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport("WAPI.dll", EntryPoint="getWorkItemListRunning")]
		private static extern String GetWorkItemListRunning(String sOwner, ref Response response);

		/// <summary>
		/// Gets the work item list running no notify.
		/// </summary>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport("WAPI.dll", EntryPoint="getWorkItemListRunningNoNotify")]
		private static extern String GetWorkItemListRunningNoNotify(String sOwner, ref Response response);

		/// <summary>
		/// Gets the work item list completed.
		/// </summary>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="response">The response.</param>
		/// <returns></returns>
		[ DllImport("WAPI.dll", EntryPoint="getWorkItemListCompleted")]
		private static extern String GetWorkItemListCompleted(String sOwner, ref Response response);

		/// <summary>
		/// Does the work item.
		/// </summary>
		/// <param name="xmlActivity">The XML activity.</param>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="response">The response.</param>
		[ DllImport("WAPI.dll", EntryPoint="doWorkItem")]
		private static extern void DoWorkItem(String xmlActivity, String sOwner, ref Response response);

		/// <summary>
		/// Completes the work item.
		/// </summary>
		/// <param name="xmlActivity">The XML activity.</param>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="sResultCode">The s result code.</param>
		/// <param name="response">The response.</param>
		[ DllImport("WAPI.dll", EntryPoint="completeWorkItem")]
		private static extern void CompleteWorkItem(String xmlActivity, String sOwner, String sResultCode, ref Response response);

		/// <summary>
		/// Completes the work item synch.
		/// </summary>
		/// <param name="xmlActivity">The XML activity.</param>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="sResultCode">The s result code.</param>
		/// <param name="response">The response.</param>
		[ DllImport("WAPI.dll", EntryPoint="completeWorkItemSynch")]
		private static extern void CompleteWorkItemSynch(String xmlActivity, String sOwner, String sResultCode, ref Response response);

		/// <summary>
		/// Stops the work item.
		/// </summary>
		/// <param name="xmlActivity">The XML activity.</param>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="response">The response.</param>
		[ DllImport("WAPI.dll", EntryPoint="stopWorkItem")]
		private static extern void StopWorkItem(String xmlActivity, String sOwner, ref Response response);

		/// <summary>
		/// Releases the work item.
		/// </summary>
		/// <param name="xmlActivity">The XML activity.</param>
		/// <param name="response">The response.</param>
		[ DllImport("WAPI.dll", EntryPoint="releaseWorkItem")]
		private static extern void ReleaseWorkItem(String xmlActivity, ref Response response);

		/// <summary>
		/// Reassigns the work item.
		/// </summary>
		/// <param name="xmlActivity">The XML activity.</param>
		/// <param name="sOwner">The s owner.</param>
		/// <param name="response">The response.</param>
		[ DllImport("WAPI.dll", EntryPoint="reassignWorkItem")]
		private static extern void ReassignWorkItem(String xmlActivity, String sOwner, ref Response response);
	}
}
